<script setup>
import { onMounted } from 'vue'
import { useAuthStore } from './stores/auth'

const authStore = useAuthStore()

onMounted(async () => {
  if (authStore.isAuthenticated) {
    try {
      await authStore.fetchCurrentUser()
    } catch (error) {
      console.error('Failed to fetch user info:', error)
    }
  }
})
</script>

<template>
  <router-view></router-view>
</template>

<style>
@import './style.css';
</style>
